/*
	环信获取token
*/
var models = require('cloud/models');
var consts = require('cloud/const');

function getHXToken(){
	AV.Cloud.httpRequest({
  	method: 'POST',
    url: 'https://a1.easemob.com/xiaocan/'+consts.APP_NAME+'/token',
    headers: {
      "Content-Type":"application/json",
    },
    body:{
      "grant_type":"client_credentials",
     // "client_id":consts.HX_CLIENT_ID,
     "client_id":"sdkfh",
      "client_secret":consts.HX_CLIENT_SECRET
    },
    success: function(httpResponse) {
      console.log(httpResponse.data);
    },
    error: function(httpResponse) {
      console.log(httpResponse.status);
    }
  });
}

exports.getHXToken = getHXToken;